"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("./util");
var mathjs_1 = require("mathjs");
var abs = function (c) { return mathjs_1.sqrt(c.re * c.re + c.im * c.im); };
var mandelbrot = function (init) { return function (z) {
    return mathjs_1.add(mathjs_1.multiply(z, z), init);
}; };
var m = util_1.recursiveOf(mandelbrot(mathjs_1.complex(-1, -0.5)), mathjs_1.complex(0, 0));
util_1.take(10)(m()).forEach(function (x) { return console.log(abs(x)); });
util_1.take(10)((util_1.filter(function (v) { return abs(v) < 2; }, m()))).forEach(function (x) { return console.log(x); });
